package commonFunc

import (
	"crypto/md5"
	"encoding/hex"
	"strconv"
)

// GenerateMsgId 生成msgId
func GenerateMsgId(uid1, uid2 int) string {
	str := strconv.Itoa(uid1) + strconv.Itoa(uid2)
	if uid1 > uid2 {
		str = strconv.Itoa(uid2) + strconv.Itoa(uid1)
	}

	hash := md5.New()
	hash.Write([]byte(str))

	return hex.EncodeToString(hash.Sum(nil))
}
